import { createRouter, createWebHashHistory } from 'vue-router'
import Index from './views/index.vue'
const routes = [
  {
    path: '/',
    component: Index,
    meta: {
      keepAlive: true
    }
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

router.beforeEach((to, from, next) => {
  if (to.meta.title) {
    document.title = to.meta.title
  }

  next()
})

export default router
